package com.css.fxfzcpxx.modules.websocket;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * @Author: xzy
 * @CreateTime: 2023/11/9 15:49
 * @Description:
 */
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {
    @Autowired
    private DataStatusHandler dataStatusHandler;
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(dataStatusHandler, "/websocket").setAllowedOrigins("*");
    }

    /*@Bean
    public WebSocketHandler dataStatusHandler() {
        return new DataStatusHandler();
    }*/



}
